package com.spark.demonetty.netty_demo.serialize.protobuf;

import java.io.IOException;

/**
 * @author fuqiang
 * @Description 生成java类
 * @Date 2020/10/22
 */
public class GenerateClass {
    public static void main(String[] args) {
        String protoFile = "person-entity.proto";//
        String strCmd = "D:/workSoft/protobuf/protobuf-2.5.0/src/protoc.exe -I=./proto --java_out=D:/proto ./proto/"+ protoFile;
        try {
            Runtime.getRuntime().exec(strCmd);
        } catch (IOException e) {
            e.printStackTrace();
        }//通过执行cmd命令调用protoc.exe程序
    }
}
